package org.beetl.support;

import java.util.List;
import java.util.Map;

/**
 * The Interface GenericDao.
 * 
 * @param <T>
 *         the generic type
 * @author zhoupan
 */
public interface GenericDao<T> {

 /**
  * Query.
  * 
  * @param paramMap
  *         the param map
  * @param offset
  *         the offset
  * @param limit
  *         the limit
  * @return the list
  */
 List<T> query(Map<String, Object> paramMap, int offset, int limit);

 /**
  * Query.
  * 
  * @param paramMap
  *         the param map
  * @param offset
  *         the offset
  * @param limit
  *         the limit
  * @return the list
  */
 List<T> query(Map<String, Object> paramMap, int offset, int limit, String methodName);

 /**
  * Query.
  * 
  * @param paramMap
  *         the param map
  * @param orderBy
  *         the order by
  * @param offset
  *         the offset
  * @param limit
  *         the limit
  * @return the list
  */
 List<T> query(Map<String, Object> paramMap, String orderBy, int offset, int limit);

 /**
  * Query.
  * 
  * @param paramMap
  *         the param map
  * @param orderBy
  *         the order by
  * @param offset
  *         the offset
  * @param limit
  *         the limit
  * @return the list
  */
 List<T> query(Map<String, Object> paramMap, String orderBy, int offset, int limit, String methodName);

 /**
  * Query.
  * 
  * @param filter
  *         the filter
  * @return the list
  */
 List<T> query(QueryFilter filter);

 /**
  * Query.
  * 
  * @param filter
  *         the filter
  * @return the list
  */
 List<T> query(QueryFilter filter, String methodName);

 /**
  * Insert.
  * 
  * @param entity
  *         the entity
  * @return the int
  */
 int insert(T entity);

 /**
  * Update.
  * 
  * @param entity
  *         the entity
  * @return the int
  */
 int update(T entity);

 /**
  * Delete.
  * 
  * @param entity
  *         the entity
  * @return the int
  */
 int delete(T entity);

 /**
  * Delete.
  * 
  * @param id
  *         the id
  * @return the int
  */
 int delete(java.io.Serializable id);

 /**
  * Delete all.
  * 
  * @param paramMap
  *         the param map
  * @return the int
  */
 int deleteAll(Map<String, Object> paramMap);

 /**
  * Count.
  * 
  * @param paramMap
  *         the param map
  * @return the int
  */
 long count(Map<String, Object> paramMap);

 /**
  * Count.
  * 
  * @param paramMap
  *         the param map
  * @return the int
  */
 long count(Map<String, Object> paramMap, String methodName);

 /**
  * Gets the.
  * 
  * @param id
  *         the id
  * @return the t
  */
 T get(java.io.Serializable id);

 /**
  * Save.
  * 
  * @param entity
  *         the entity
  * @return the int
  */
 int save(T entity);

}